const app = getApp();
function request(url, type, data = {}, callback){
  wx.request({
    url,
    method:type,
    header: {
      "X-Nideshop": app.globalData.token
    },
    data,
    success:function(res){
      callback(res)
      wx.showToast({
        title: '请求成功',
      })
    },
    fail:function(){
      wx.showToast({
        title: '请求失败',
      })
    }
  })
}
module.exports = {
  request
}